﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NovoSerDes.Funcs
{
    public class USBDeviceMeditor
    {
        private SerDesComm serdesComm;

        public event EventHandler<SerDesComm> USBDeviceChanged;

        public SerDesComm USBDevice
        {
            get { return serdesComm; }
            set
            {
                if (serdesComm != value)
                {
                    serdesComm = value;
                    NotifySerDesChanged(serdesComm);
                }
            }
        }

        public void NotifySerDesChanged(SerDesComm newSerdesComm)
        {
            USBDeviceChanged?.Invoke(this, newSerdesComm);
            USBDevice = newSerdesComm;
        }
    }
}